<template>
  <span>用户注册列表</span>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column prop="name" label="姓名"  />
    <el-table-column prop="password" label="密码" />
  </el-table>
  <el-button type="primary" @click="getuser">搜索</el-button>
</template>
<script>
import axios from 'axios'
import { ElMessage, ElMessageBox } from 'element-plus'
export default {
    data(){
        return{
            tableData:[]
        }
    },
    methods:{
        getuser(){
            axios.post('http://localhost:8000/getuser',{headers:{
                'Content-Type':'application/json;charset=UTF-8',
            },}).then(
                (res) =>{
                    console.log(res)
                    this.tableData=res.data
                }
            )
        }
    },
    mounted(){
        this.getuser();
    }

}
</script>

<style>

</style>